<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
	<head>
		<script type="text/javascript">
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="userAction-"+id+"!lock.action";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){            	
            	var searchForm=document.getElementById("searchForm");
            	searchForm.action="appInterfaceParamAction-"+id+"!toEdit.action";
            	searchForm.submit();
                return true;
            }else{
                alert("请选择一条记录");
                return false;
            }
        }        
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定所选内容?');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='appInterfaceParamAction!delete.action';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
        
    </script>
	</head>
	<body onload="displayResult()">
		<s:form method="post"
			action="appInterfaceParamAction!queryByPage.action" theme="simple"
			id="searchForm">
			<div id="div_title">
				<h3>
					应用接口参数查询
				</h3>
				<div id="div_search">
					<table>
						<tr>
							<!-- 查询条件 -->
							
							<td width="80" align="right">
								应用接口:
							</td>
							<td>
								<s:select list="appInterfaceMap" headerKey=""  headerValue="-全部-"
										name="query_interfaceId" id="query_interfaceId"
										value="query_interfaceId" >
						         </s:select>
							</td>
							<td width="80" align="right">
								参数Key:
							</td>
							<td>
								<s:textfield name="query_paramKey" />
							</td>
							<td width="80" align="right">
								参数名称:
							</td>
							<td>
								<s:textfield name="query_paramName" />
							</td>
						</tr>
						
							<td width="80" align="right">
								类型:
							</td>
							<td>
								<s:textfield name="query_type" />
							</td>
							<td width="80" align="right">
								状态:
							</td>
							<td>
								<s:textfield name="query_status" />
							</td>
							<td width="80" align="right">
								<authz:authorize ifAnyGranted="OMC_APP_INTERFACE_PARAM">
									<s:submit cssClass="submit_search" value="搜索"
										action="appInterfaceParamAction!queryByPage" />
								</authz:authorize>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div id="div_button">
				<authz:authorize ifAnyGranted="OMC_APP_INTERFACE_PARAM">
					<s:submit value="新增"
						onclick="form.action='appInterfaceParamAction!toAdd.action';return true;"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="OMC_APP_INTERFACE_PARAM">
					<s:submit value="修改" onclick="return validateModify()"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="OMC_APP_INTERFACE_PARAM">
					<input type="button" value="删除"
						onclick="if(validateDelete()){doDelete()}" class="input_button">
				</authz:authorize>
				<%@include file="/white/common/message.jsp"%>
			</div>
			<!--列表 �?�� -->
			<table cellpadding="0" cellspacing="0" class="t_list">
				<tr>
					<th>
						<input type="checkbox" onclick="selectCheckbox();"
							name="checkbox2" value="checkbox" />
					</th>
					<!--列表头部 -->
					
					<th>
						接口
					</th>
					
					<th>
						参数名称
					</th>
					<th>
						参数Key
					</th>
					<th>
						备注
					</th>
					<th>
						创建用户
					</th>
					<th>
						创建时间
					</th>
					<th>
						最后更新用户
					</th>
					<th>
						最后更新时间
					</th>
					<th>
						类型
					</th>
					<th>
						状态
					</th>
					<th>
						同步人
					</th>
					<th>
						同步时间
					</th>
				</tr>
				<s:iterator value="resultList" status="sindex">
					<tr>
						<td>
							<input type="checkbox" name="selectedIds"
								value="${ INTERFACE_PARAM_ID }" id="selectedIds" />
						</td>
						
						<td>
							<s:property value="INTERFACE_NAME" />
						</td>
						<td>
							<s:property value="PARAM_NAME" />
						</td>
						<td>
							<s:property value="PARAM_KEY" />
						</td>
						
						<td>
							<s:property value="NOTE" />
						</td>
						<td>
							<s:property value="CREATE_USER" />
						</td>
						<td>
							<s:property value="CREATE_TIME" />
						</td>
						<td>
							<s:property value="LAST_UPDATE_USER" />
						</td>
						<td>
							<s:property value="LAST_UPDATE_TIME" />
						</td>
						<td>
							<s:property value="TYPE" />
						</td>
						<td>
							<s:property value="STATUS" />
						</td>
						<td>
							<s:property value="LAST_SYNCHRONIZATION_USER" />
						</td>
						<td>
							<s:property value="LAST_SYNCHRONIZATION_TIME" />
						</td>
					</tr>
				</s:iterator>
			</table>
			<!--列表 结束 -->
			<!--分页 �?�� -->
			<s:if test="resultList.size() > 0">
				<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
					<tr>
						<td><%@include file="/white/common/pageList.jsp"%></td>
					</tr>
				</table>
			</s:if>
			<!--分页 结束 -->

		</s:form>
	</body>
</html>
